package com.stx.entity;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;


@Entity
@Table(name="fc_fiilm_images")
@SequenceGenerator(name="im_id",sequenceName="im_id",initialValue=1,allocationSize=1)
public class Film_image {

	 @Id
	 @Column(nullable=false)
	 @GeneratedValue(generator="im_id",strategy=GenerationType.SEQUENCE)
	 private long im_id;
	 
	 private String im_image;

	 @ManyToOne(cascade= {CascadeType.PERSIST,CascadeType.MERGE},fetch=FetchType.EAGER,optional=false)
	 @JoinColumn(name="fi_id")
	 private Film film;
	 
	 
	 
	public Film getFilm() {
		return film;
	}

	public void setFilm(Film film) {
		this.film = film;
	}

	public long getIm_id() {
		return im_id;
	}

	public void setIm_id(long im_id) {
		this.im_id = im_id;
	}

	public String getIm_image() {
		return im_image;
	}

	public void setIm_image(String im_image) {
		this.im_image = im_image;
	}
	 
	 
}
